package com.lntea.security.base64;

import org.apache.commons.codec.binary.Base64;


/**
 * @author Administrator
 *
 */
public class LnteaBase64 {
	private static String text = "lntea security base64";
	
	public static void main(String[] args) {
		ccBase64();
		bcBase64();
	}
	
	public static void jdkBase64(){
		
	}
	public static void ccBase64(){
		byte[] encodeBytes = Base64.encodeBase64(text.getBytes());
		System.out.println("common codec base64 encode:" + new String(encodeBytes));
		
		byte[] decodeBytes = Base64.decodeBase64(encodeBytes);
		System.out.println("common codec base64 decode :" + new String(decodeBytes));
	}
	
	public static void bcBase64(){
		byte[] encodeBytes = org.bouncycastle.util.encoders.Base64.encode(text.getBytes());
		System.out.println("bouncy castle base64 encode:" + new String(encodeBytes));
		
		byte[] decodeBytes = org.bouncycastle.util.encoders.Base64.decode(encodeBytes);
		System.out.println("bouncy castle base64 decode:" + new String(decodeBytes));
	}
}
